import { selGoodsTypes } from '../services/homeGoods'


export default {

  namespace: 'homeGoods',

  state: {
      goodsTypes:[]
  },



  effects: {
    *selGoodsType({ payload }, { call, put }) {  // eslint-disable-line
      const resp = yield call(selGoodsTypes,payload)
      yield put(
        { type: 'selGType' ,
          state: {
            goodsTypes: resp.data.data
          }
        }
      );
      return resp;
    },
  },

  reducers: {
    selGType(state, action) {
      return { ...state, ...action.state };
    },
  },

};
